package com.factory.controller;

import com.factory.domain.OperationRecord;
import com.factory.domain.pageData;
import com.factory.http.AjaxResult;
import com.factory.service.IOperationRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static com.factory.http.AjaxResult.success;
import static com.factory.http.AjaxResult.toAjaxResult;

/**
 * 【请填写功能名称】Controller
 * 
 * @author ruoyi
 * @date 2024-07-22
 */
@RestController
@RequestMapping("/system/record")
public class OperationRecordController
{

    @Autowired
    private IOperationRecordService operationRecordService;
    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/list")
    public AjaxResult list(OperationRecord operationRecord)
    {
        List<OperationRecord> list = operationRecordService.selectOperationRecordList(operationRecord);
        return success(list);
    }
    /**
     * 新增保存【请填写功能名称】
     */
    @PostMapping("/add")
    public AjaxResult addSave(@RequestBody OperationRecord operationRecord)
    {
        return toAjaxResult(operationRecordService.insertOperationRecord(operationRecord));
    }
    /**
     * 分页查询数据
     **/
    @PostMapping("/listPage")
    public AjaxResult listPage(@RequestBody pageData pageData) {
        List<OperationRecord> operationRecordList=operationRecordService.selectOperationRecordListPage(pageData);
        return success(operationRecordList);
    }
}
